package com.zzh.base.component;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.zzh.base.utils.AutoUtils;

public abstract class BaseActivity extends AppActivity {

    private View rootView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        superBefore();
        super.onCreate(savedInstanceState);
        superAfter();
    }

    public void superAfter() {
    }


    public void superBefore() {
        rootView = getRootView();
        if (isAutoSize) {
            AutoUtils.setSize(this, false, 720, 1080);
            AutoUtils.auto(rootView);
        }
        findView();
        setClickLinsener();
        configRootView(rootView);
    }

    public abstract View getRootView();

    public abstract void findView();

    public abstract void setClickLinsener();

    public <T extends View> T findBaseViewById(int id) {
        return rootView.findViewById(id);
    }
}
